package com.example.xianji.adapter;

import java.util.ArrayList;

import com.example.xianji.R;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class Help_Adapter extends BaseAdapter {
    private ArrayList<String> list;
    private Context context;

    public Help_Adapter(ArrayList<String> list, Context context) {
        super();
        this.list = list;
        this.context = context;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return position;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            convertView = View.inflate(context, R.layout.help_listview_item, null);
            TextView text = (TextView) convertView.findViewById(R.id.text);
            text.setText(list.get(position));
        }
        return convertView;
    }
}